import React from 'react';
import { TouchableOpacity, Text, StyleSheet, ActivityIndicator } from 'react-native';
import { primaryColor } from '../utils';

const styles = StyleSheet.create({
  spinner: {
    marginRight: 16
  },
  button: {
    color: primaryColor,
    fontSize: 17,
    padding: 14 
  }
});

export default ({onPress, chinese, title, processing}) =>
  processing?<ActivityIndicator style={styles.spinner} color={primaryColor}/>:
  <TouchableOpacity style={styles.container} onPress={onPress}>
    <Text style={styles.button}>{title||(chinese?'下一步':'Next')}</Text>
  </TouchableOpacity>;